package com.asset.salesforce.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.asset.salesforce.dao.CallDaoImpl;
import com.asset.salesforce.domain.Call;

@Service
@Transactional(readOnly=true)
public class CallService {
	@Autowired
	private CallDaoImpl callDaoImpl;
	
	@Transactional(readOnly = false)
	public void addCall(Call call){
		callDaoImpl.add(call);
	}
	@Transactional(readOnly = false)
	public void saveOrUpdate(Call call){
		callDaoImpl.saveOrUpdate(call);
	}
	
	@Transactional(readOnly = true)
	public Call getCallnById(Call call,Integer id){
		return callDaoImpl.getById(id,call);
	}
	@Transactional(readOnly = true)
	public List<Call> getAllCall(Call call){
		return callDaoImpl.getAll(call);
	}
	@Transactional(readOnly = true)
	public List<Call> getCallByParentId(Integer parentId, String parentType){
		return callDaoImpl.getCallByParentId(parentId, parentType);
	}
	public List<Call> getCallEventsByEmployeeId(Integer empId,Integer parentId){
		return callDaoImpl.getCallEventsByEmployeeId(empId,parentId);
	}
	@Transactional(readOnly=true)
	public List<Call> getCallEventsByEmployeeIdAndDate(Integer empId) {
		return callDaoImpl.getCallEventsByEmployeeIdAndDate(empId);
	}

}
